home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / MOVEOVER.H < prev    next >
Text File  |  1988-05-30  |  1KB  |  39 lines

  1. /* -*-C-*- moveover.h */
  2. /*-->moveover*/
  3. /**********************************************************************/
  4. /****************************** moveover ******************************/
  5. /**********************************************************************/
  6.  
  7. void
  8. moveover(b)
  9. register INT32 b;
  10.  
  11. {
  12.     /*    From DVITYPE Version 2.6:
  13.     "Rounding to the nearest pixel is  best done in the manner shown
  14.     here, so as to  be inoffensive to the  eye: When the  horizontal
  15.     motion is small, like a kern, |hh| changes by rounding the kern;
  16.     but when the motion is large, |hh| changes by rounding the  true
  17.     position |h| so that  accumulated rounding errors disappear.  We
  18.     allow a  larger space  in  the negative  direction than  in  the
  19.     positive one, because TeX  makes comparatively large  backspaces
  20.     when it positions accents."
  21.  
  22.     The one precaution we need to  take here is that fontptr can  be
  23.     NULL, which we treat like  a large movement.  This NULL  pointer
  24.     was used without error  on many different  machines for 2  years
  25.     before it was caught on the VAX VMS implementation, which  makes
  26.     memory page 0 inaccessible.
  27.     */
  28.     h += b;
  29.     if ((fontptr == (struct font_entry *)NULL) ||
  30.     ABS(b) >= fontptr->font_space)
  31.     hh = PIXROUND(h, conv) + lmargin;
  32.     else
  33.     {
  34.     hh += PIXROUND(b, conv);
  35.     hh = fixpos(hh-lmargin,h,conv) + lmargin;
  36.     }
  37. }
  38.  
  39.